<?php
if(!defined('IN_SONG')) exit('No direct script access allowed');
/**
 * WIDGET TAB HOME
 *
 * @author          DiepVD <diepvuongdac@vccorp.vn>
 * @package         Widget
 * @subpackage      Widget.Tab_Home
 * @version         1.0
 * @copyright       VCCorp (c) 2010
 */
class TabHome_Widget extends Module
{
    function __construct()
    {
        parent::__construct();
    }

    function draw()
    {
        $this->Template->setFile('WTabHome', 'widgets/tab.home.html');
        $this->Template->setBlock('WTabHome', 'TabHomes', 'TabHome');
        $arrTab = array(
            array('id' => 'mnuControl', 'title' => 'Control Panel', 'path' => 'admin_home'),
            array('id' => 'mnuUsers', 'title' => 'Quản lý user', 'path' => 'admin_user'),
            array('id' => 'mnuContent', 'title' => 'Xem log chơi game', 'path' => 'admin_log'),
            array('id' => 'mnuContent', 'title' => 'Quản lý ván chơi', 'path' => 'admin_set'),
            array('id' => 'mnuContent', 'title' => 'SMS', 'path' => 'admin_sms'),
            array('id' => 'mnuContent', 'title' => 'SMS Error', 'path' => 'admin_sms_error'),
            array('id' => 'mnuContent', 'title' => 'SMS Daily Quantity', 'path' => 'admin_sms_quantity')
        );
        $html = '';
        for($i=0;$i<sizeof($arrTab);$i++)
        {
            $arrVar = array('id' => $arrTab[$i]['id'], 'title' => $arrTab[$i]['title'], 'Url' => Url::buildUrl(null, $arrTab[$i]['path'], true));
            if($_GET['module'] ==  $arrTab[$i]['path'])
                $arrVar['classActive'] = ' class="Active"';
            else
                $arrVar['classActive'] = '';
            $this->Template->setVar($arrVar);
            $this->Template->parse('TabHome', 'TabHomes', true);
        }

        return $this->Template->Result('WTabHome');
    }
}
?>
